#pragma warning( disable : 4996 )

#define cin ccin
#include <fstream>
ifstream ccin("input.txt");
ifstream ccout("output.txt");
stringstream _cout;

struct Test {
	~Test() {
		stringstream &ss = _cout;
		int static testno(1);
		char line[1024] = {0};
		char testline[1024] = {0};

		cout << "Case: #" << testno++ << " ";

		bool res(true);
		bool tested(false);

		while (ss) {
			ss.getline(line, sizeof(line));
			if (!ss) {
				break;
			}
			ccout.getline(testline, sizeof(line));

			if (strcmp(line, testline) != 0) {
				cout << "\nERROR " << line << " != " << testline;
				res = false;
			}
			tested = true;
		}
		ss.clear();
		if (!tested) {
			cout << "\nERROR: no data\n";
		} else if (res) {
			cout << "SUCCESS\n";
		} else {
			cout << "\n";
		}
	}
};

struct TesterMain {
	~TesterMain() {
		std::cout << "\npress enter\n";
		getchar();
	}
} tester;

#define cout _cout
